﻿#ifndef MAINWIDGET_H
#define MAINWIDGET_H

#include "Widget.h"
#include "systemsetting_1.h"
#include "systemsetting_2.h"
#include "systemsetting_3.h"
#include "systemsetting_4.h"
#include "chargecardmanageinfo.h"
#include "RecordOfCharge.h"
#include "FilterRecordOfCharge.h"
#include "WaringInfo.h"
#include "ExportRecordOfCharge.h"
#include "CarVertify.h"
#include "ChargeType.h"
#include "SettingOfChargeMoney.h"
#include "SettingOfChargePower.h"
#include "SettingOfChargeTime.h"
#include "MaintainLoging.h"
#include "WarnningDetailInfo.h"
#include "ChargeSubscribe.h"
#include "ChargeWatchingDC.h"
#include "ChargeWatchingAC.h"
#include "SettleAccount.h"
#include "RetrunChargeGun.h"
#include "EndOfChargeVerify.h"
#include "ChargeGunNotConnect.h"
#include "ChargeGunNotNotConnect.h"
#include "CarAndQRCodeVerify.h"
#include "EquipmentMaintaince.h"
#include "EquipmentUpgrade.h"
#include "WaitSwipCard.h"
#include "NetworkInfo.h"
#include "ChooseGun.h"
#include "Outstanding_Order.h"
#include "GuninfoSetting.h"
#include "ChangeGuninfo.h"
#include "SetRate.h"
#include <QStackedLayout>
#include <QVBoxLayout>
#include "Global.h"
#include "MyThread.h"
#include "shareMemory.h"
#include <QTimer>
#include <QSharedMemory>
#include <QDebug>
#include "card/libcard.h"
#include "signal/libtcu1.06.h"


class MainWidget : public QWidget
{
    Q_OBJECT

public:
    QDateTime systemTime;
    QPixmap* pixmapsignal;

    QTimer heart;
    QTimer UpdateDate;
    QTimer UpdateSignal;
    QTimer Gun_Showing;//定时取出枪的结构体内容,需要知道当前焦点的枪号
    Debug  DebugTimer;//打印调试信息的定时器
    QTimer timerUpdateDevice;
    void SignalsConnect();
    void onCreateSharedMemory();
    void onCreateUi();
    explicit MainWidget(QWidget *parent = 0);
    ~MainWidget();

signals:
    void Off_line();
    void On_line();

protected slots:
    void takeout_guninfo();
    void Gun_Showing_timeout();
    void onUpdateTime();
    void onUpdateSignal();
    void heartFunction();
//    void qDebugInfo();
    void onUpdateDevice();

private:
    int checkShareMemory;
    int line_flag;
    Widget* UseWait;
    SystemSetting_1* SystemSetting1;
    Systemsetting_2* SystemSetting2;
    SystemSetting_3* SystemSetting3;
    SystemSetting_4* SystemSetting4;
    RecordOfCharge* RecordofCharge;
    ChargeCardManageInfo* ChargeCardManage;
    FilterRecordOfCharge* FilterRecordofCharge;
    WaringInfo* WaringInfomation;
    ExportRecordOfCharge* ExportRecordofCharge;
    CarVertify* Carvertify;
    ChargeType* Chargetype;
    SettingOfChargeMoney* SettingofChargeMoney;
    SettingOfChargePower* SettingofChargePower;
    SettingOfChargeTime* SettingofChargeTime;
    MaintainLoging* Maintainloging;
    WarnningDetailInfo* Waringinfomation;
    ChargeSubscribe* Chargesubscribe;
    ChargeWatchingDC* ChargewatchingDC;
    ChargeWatchingAC* ChargewatchingAC;
    SettleAccount* Settleaccount;
    RetrunChargeGun* ReturnchargeGun;
    EndOfChargeVerify* EndofChargeVerify;
    ChargeGunNotConnect* ChargeGunnotConnect;
    ChargeGunNotNotConnect* ChargeGunnotnotConnect;
    CarAndQRCodeVerify* CarAndqRCodeVerify;
    EquipmentMaintaince* Equipmentmaintaince;
    EquipmentUpgrade* Equipmentupgrade;
    WaitSwipCard* WaitSwipcard;
    NetworkInfo* Networkinfo;
    ChooseGun* Choosegun;
    Outstanding_Order* OutstandingOrder;
    GuninfoSetting* Guninfosetting;
    ChangeGuninfo* Changeguninfo;
    SetRate* Setrate;
};
#endif // MAINWIDGET_H
